package com.jiangnan.warehouse_management.pojo;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.sql.Timestamp;


@TableName("warehouses")
@Data
public class Warehouse {
    @TableId(type = IdType.ASSIGN_ID)  // 改为雪花算法
    private Integer warehouseId;
    private String warehouseName;
    private String location;
    private Double capacity;
    private Boolean status;
    private Integer managerId;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    @TableField(fill = FieldFill.INSERT) // 仅插入时填充
    private Timestamp createdAt;
    @TableField(fill = FieldFill.INSERT_UPDATE) // 插入和更新时都填充
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private Timestamp updatedAt;
}